package de.silvalauinger.objectclassmapper.schema.system.objectclass;

import static com.google.common.base.Preconditions.checkNotNull;
import static de.silvalauinger.objectclassmapper.schema.DefaultSchemaManagerFactory.SCHEMA_MANAGER;
import de.silvalauinger.objectclassmapper.schema.system.attribute.ObjectClass;
import static org.apache.directory.shared.ldap.model.constants.SchemaConstants.TOP_OC_OID;

abstract class Top {

    //<editor-fold defaultstate="collapsed" desc="Statics">
    public final static org.apache.directory.shared.ldap.model.schema.ObjectClass OBJECTCLASS_TYPE = checkNotNull(SCHEMA_MANAGER.getObjectClassRegistry().get(TOP_OC_OID));

    protected final static <T> T requiredAttribute(final T attribute, final String attributeName) {
        return checkNotNull(attribute, "%s is a required attribute in this objectclass.", attributeName);
    }
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="Attributes">
    private ObjectClass objectClass;
    //</editor-fold>

    public ObjectClass getObjectClass() {
        return objectClass;
    }
}